package xyz.hzxiao.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.hzxiao.annotation.Authentication;
import xyz.hzxiao.enums.PermissionsEnum;

/**
 * 权限验证控制器
 *
 * @author ：FuXx
 * @className : xyz.hzxiao.controller.TestController
 * @since ：2023-08-15
 */
@RestController
public class AuthenticationController {

    private final static Logger log = LoggerFactory.getLogger(AuthenticationController.class);

    @GetMapping("/test1")
    public String test1() {
        log.info("say hello");
        return "say hello";
    }

    @GetMapping("/test")
    @Authentication(PermissionsEnum.QUERY)
    public String test() {
        return "Hello World test";
    }
}
